<%@page import="com.kensure.shike.constant.BusiConstant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>详情</title>
	<meta http-equiv="Content-Type" content="textml; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	
	<link href="<%=BusiConstant.context%>/page1/webview/css/index.css" rel="stylesheet" type="text/css" media="all" />
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/js/jquery.min.js"></script>
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/base.js?ver=<%=BusiConstant.version%>"></script>
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/http.js?ver=<%=BusiConstant.version%>"></script>
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=BusiConstant.context%>/common/css/botton.css">
	<link rel="stylesheet" type="text/css" href="<%=BusiConstant.context%>/common/layui/css/layui.css">
</head>
<style>
 img{max-width:100%}
</style>
<body class="loading">

	<div class="wrapper">	
	   	<div class="whole" id="list">
	   		
	   	</div>    
	   
	</div>

	 <div id="dg" style="text-align:center;">
				<button id="btn1" onclick="share()" style="width:100px;"  class="layui-btn layui-btn-normal">分享海报</button>	
				<button id="btn2" onclick="goindex()" style="width:100px;"  class="layui-btn layui-btn-normal">回到首页</button>
	 </div>
	
<br><br>
</body>

<script>
var basecontext = '<%=BusiConstant.context%>';
var id = getQueryVariable("id");
var tokenid = getQueryVariable("token");
var showrow = null;
addcookie(tokenid);
function getList(){
	var url = getbaseurl("/cms/get.do");
	var data = {id:id};
	postdo(url, data, function(data){
		var row = data.resultData.row;
		showrow = row;
		showtable(row);
	}, null, null);
}
getList();

var tuser = null;
function getuserbytoken(){
	var url = getbaseurl("/user/getuser.do");
	var data = {token:tokenid};
	postdo(url, data, function(data){
		tuser = data.resultData.row;
	}, null, null);
}
getuserbytoken();


function showtable(row){
	var html = '<div class="ations" >'
	+'<strong style="padding: 10px 10px;font-size:20px; text-align: center;font-weight: 800;">'
	+'<span>'+row.title+'</span>'
	+'</strong>'
	+'<ul>';	
	html += '<div style="padding:10px 10px;min-height:600px;">'
		+'<p >'+row.content+'</p>'
		+'</div>';
	html += '</ul>';
	html += '</div>';
	$("#list").html(html);
}

function share(){
	var url = showrow.id + ',' + tuser.id;
	var picurl = '<%=BusiConstant.getHttpsFullUrl("/ziyuan/1234.png")%>';
    var datatemp = { url: url, name: showrow.title, pic: encodeURIComponent(picurl), path:"pages/dp/tz"};
    wx.miniProgram.navigateTo({
      url: "/pages/goods-details/poster?datastr=" + JSON.stringify(datatemp) 
    })
}

function goindex(){
	wx.miniProgram.switchTab({url: '/pages/index/index'})
}


</script>

</html>
